import { Component } from '@angular/core';
import {HttpClient} from "@angular/common/http"
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title:number = 10000000;
  lists:any = [
    {name:"html"},
    {name:"css"},
    {name:"js"}
  ];
  result:any=[];
  constructor(public http:HttpClient){}
  handleClick():void{
    console.log("click");
    this.title += 1 ; 
  };
  deal(count:number):number{
    return count+1
  }
  ngOnInit(){
    var url:string = "http://localhost:8000/top250"
    console.log("初始化");
    this.http.get(url).subscribe((res:any)=>{
      this.result = res.result
      console.log(this.result);
    })
  }
}
